import { authService } from "@/services";
import { PropsWithChildren } from "react";
import { Navigate, Outlet } from "umi";

const AppWrapper = () => {
  const isAuth = authService.getAuth();

  if (!isAuth) {
    return <Navigate to="/login" replace />;
  }

  return <Outlet />;
};

export default AppWrapper;
